﻿using System.Collections.Generic;
using System.Linq;

namespace Dsl.Ped.Framework.Helpers
{
    /// <summary>
    /// Helper methods for the enumerables
    /// </summary>
    public static class EnumerableHelper
    {
        /// <summary>
        /// Extension method - Check the IEnumerable collection is null or empty
        /// </summary>
        /// <typeparam name="T">Type of collection</typeparam>
        /// <param name="enumerable">Colleciton to check</param>
        /// <returns>True if collection is null or empty</returns>
        public static bool IsNullOrEmpty<T>(IEnumerable<T> enumerable)
        {
            return enumerable == null || !enumerable.Any();
        }
    }
}
